home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14392 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  29 lines

  1. Newsgroups: comp.lang.c
  2. Path: gail.ripco.com!mambuhl
  3. From: mambuhl@ripco.com (Martin Ambuhl)
  4. Subject: Re: Q:Hex to Decimal?    
  5. Message-ID: <DpuM6F.8Mq@rci.ripco.com>
  6. X-Nntp-Sender: mambuhl@foley.ripco.com
  7. Sender: usenet@rci.ripco.com (Net News Admin)
  8. Organization: Ripco Internet BBS Chicago
  9. Date: Sun, 14 Apr 1996 10:51:50 GMT
  10.  
  11. huang@mnsinc.com (Szu-Wen Huang) in <4klr9f$29d@news1.mnsinc.com>
  12. corrected my <DpqLyJ.8Jy@rci.ripco.com>:
  13.  
  14. >:         sprintf(target_string,"x",(unsigned)your_integer);
  15.  
  16. >Which prints an "x" to your string and formats your hard disk if you
  17. >have a mean C compiler.  :)  Try "%x" as the format string.
  18.  
  19. Thanks for the correction.  However, since in my erroneous line
  20. (unsigned)your_integer is an excess argument, and the behavior for such
  21. is defined (ISO 7.9.6.1, lines 3-5 of description), it will take worse
  22. than a "mean C compiler" to format my hard disk.  It will take a broken
  23. one.
  24.  
  25.                                                     
  26. --
  27. * Martin Ambuhl       net: mambuhl@ripco.com
  28. * Chicago, IL (USA)    
  29.